#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>

int main()
{
	int a = 0;
	int i = 0;
	int count = 0;
	int num = 0;
	scanf("%d", &a);
	for (i = 0; i < 5; i++)
	{
		num = num + pow(10, i) * a;
		count += num;
	}
	
	printf("%d\n", count);
	
	return 0;
}
